﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ProjectWebNhac.DAO;
using System.Data;
using ProjectWebNhac.DTO;
namespace ProjectWebNhac.BUS
{
    public class BinhLuanBaiHatBus
    {
        public BinhLuanBaiHatBus() { }
        Dataprovider dao = new Dataprovider();
        public DataTable LayListBinhLuan(int MaBaiHat)
        {
            return dao.LayDuLieuThamSo("sp_User_LayBinhLuanBaiHatTheoMaBaiHat",
                CommandType.StoredProcedure, new object[] { "@MaBaiHat", MaBaiHat });
        }

        public DataTable LayChiTietBinhLuan(int MaBinhLuan)
        {
            return dao.LayDuLieuThamSo("sp_Admin_LayBinhLuanBaiHatTheoMaBinhLuan",
                CommandType.StoredProcedure, new object[] { "@MaBinhLuan", MaBinhLuan });
        }

        public DataTable LayHetListBinhLuan()
        {
            return dao.LayDuLieuThamSo("sp_User_LayBinhLuanBaiHat",
                CommandType.StoredProcedure);
        }

        public bool ThemBinhLuan(BinhLuanBaiHatDTO objBinhLuan)
        {
            return dao.XuLySuKien("sp_User_ThemBinhLuanBaiHat", CommandType.StoredProcedure,
                new Object[] {"@taikhoan",objBinhLuan.TaiKhoan,"@LoiBinh",
                objBinhLuan.LoiBinh,"@MaBaiHat",objBinhLuan.MaBaiHat});
        }

         public bool XoaBinhLuan( int MaBinhLuan)
        {
            return dao.XuLySuKien("sp_Admin_XoaBinhLuanBaiHat", CommandType.StoredProcedure,
                   new Object[] {"@MaBinhLuan",MaBinhLuan});
        }

    }
}